<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>攻防演练</title>
{#    <link rel="stylesheet" type="text/css" href="css/reset.css">#}
    <script type="text/javascript" src="../static/js/jquery-1.12.4.min.js"></script>
    {#    <script type="text/javascript" src="../static/js/index.js"></script>#}
    <script>
        function getjson() {
            var radio = new Array();
            for (var i = 1; i <= 5; i++) {//获取radio的值
                var radio_name = new String("radio_" + i);
                radio[i - 1] = $('input:radio[name=' + radio_name + ']:checked').val()
            }
            for (var i = 1; i <= 2; i++) {//获取checkbox的的输入
                var checkbox_name = new String("checkbox_" + i);
                var chk_value = [];
                $('input:checkbox[name=' + checkbox_name + ']:checked').each(function () {
                    chk_value.push($(this).val());
                });
                radio[i + 4] = "";//置为空
                for (var j = 0; j < chk_value.length; j++) {
                    radio[i + 4] = radio[i + 4] + chk_value[j];
                }
            }
            //数组转json串
            var json = JSON.stringify(radio);
            return json;
        }
        function my_confirm() {
            var json = getjson();
            var msg = "您真的答案是：" + json + ",是否确认提交";
            if (confirm(msg) == true) {
                window.location.href = "result.html?radio=" + 5 + "checkbox=" + 2 + "&json=" + json;
            } else {
                return false;
            }
        }
        $(function () {
            var m = 30;
            var s = 0;
            setInterval(function () {
                if (m >= 0) {
                    if (s < 10) {
                        $('#time').html("剩余时间：" + m + ':0' + s);
                    } else {
                        $('#time').html("剩余时间：" + m + ':' + s);
                    }
                    s--;
                    if (s < 0) {
                        s = 59;
                        m--;
                    }
                    if (m == 0 && s < 1) {
                        window.location.href = "result.html?radio=" + 5 + "checkbox=" + 2 + "&json=" + getjson();
                    }
                }
            }, 1000)
        })
    </script>
</head>
<body>
<div>
    <h3 style="float: left">上海并擎软件科技有限公司2019年CTF攻防比赛</h3>

    <div id="time" style="color:red;float: right;margin: 12px 20px 0 0;padding: 0 0 0 0;font-size: xx-large"></div>

    <br/><br/><br/>
    <h1>单选题</h1>
    <h2>说明:一共60道选择题,总分300分.答题时间为30分钟.每两题为一组,需要同时答对一组的两道题才能得10分.</h2>
    <div>
        <form class="comment_form" method="post" action="result.html">
            <span>第1题</span>
            <p>“出淤泥而不染，濯清涟而不妖”是周敦颐称赞什么的名句？</p><br>
            <input type="radio" name="radio_1" value="A" id="A1"><label for="A1">A:牡丹</label>&nbsp&nbsp&nbsp&nbsp
            <input type="radio" name="radio_1" value="B" id="B1"><label for="B1">B:菊花</label>&nbsp&nbsp&nbsp&nbsp
            <input type="radio" name="radio_1" value="C" id="C1"><label for="C1">C:莲花</label>&nbsp&nbsp&nbsp&nbsp
            <input type="radio" name="radio_1" value="D" id="D1"><label for="D1">D:梅花</label><br><br>

            <span>第2题</span>
            <p>下列哪首诗歌因音律优美，被叶圣陶称赞“为中国新诗的音节开了一个新纪元”？</p><br>
            <input type="radio" name="radio_2" value="A" id="A2"><label for="A2">A:《再别康桥》</label>&nbsp&nbsp&nbsp&nbsp
            <input type="radio" name="radio_2" value="B" id="B2"><label for="B2">B:《雨巷》</label>&nbsp&nbsp&nbsp&nbsp
            <input type="radio" name="radio_2" value="C" id="C2"><label for="C2">C:《沁园春 长沙》</label>&nbsp&nbsp&nbsp&nbsp
            <input type="radio" name="radio_2" value="D" id="D2"><label for="D2">D:《大堰河--我的保姆》</label><br><br>

            <span>第3题</span>
            <p>“国家兴亡，匹夫有责”一句语出自谁？</p><br>
            <input type="radio" name="radio_3" value="A" id="A3"><label for="A3">A:魏征</label>&nbsp&nbsp&nbsp&nbsp
            <input type="radio" name="radio_3" value="B" id="B3"><label for="B3">B:陆游</label>&nbsp&nbsp&nbsp&nbsp
            <input type="radio" name="radio_3" value="C" id="C3"><label for="C3">C:顾炎武</label>&nbsp&nbsp&nbsp&nbsp
            <input type="radio" name="radio_3" value="D" id="D3"><label for="D3">D:魏源</label><br><br>

            <span>第4题</span>
            <p>“投笔从戎”的故事发生在谁的身上？</p><br>
            <input type="radio" name="radio_4" value="A" id="A4"><label for="A4">A:班超</label>&nbsp&nbsp&nbsp&nbsp
            <input type="radio" name="radio_4" value="B" id="B4"><label for="B4">B:秋瑾</label>&nbsp&nbsp&nbsp&nbsp
            <input type="radio" name="radio_4" value="C" id="C4"><label for="C4">C:陆游</label>&nbsp&nbsp&nbsp&nbsp
            <input type="radio" name="radio_4" value="D" id="D4"><label for="D4">D:项羽</label><br><br>

            <span>第5题</span>
            <p>子在川上曰：“逝者如斯夫！不舍昼夜。”其中“逝者”指的是什么？</p><br>
            <input type="radio" name="radio_5" value="A" id="A5"><label for="A5">A:失去的人</label>&nbsp&nbsp&nbsp&nbsp
            <input type="radio" name="radio_5" value="B" id="B5"><label for="B5">B:流淌的水</label>&nbsp&nbsp&nbsp&nbsp
            <input type="radio" name="radio_5" value="C" id="C5"><label for="C5">C:消逝的友情</label>&nbsp&nbsp&nbsp&nbsp
            <input type="radio" name="radio_5" value="D" id="D5"><label for="D5">D:消逝的时光</label><br><br>


            <input type="submit" value="提交答案">
        </form>

    </div>
</div>


</body>
</html>